package com.example.demo.common;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: lishuo
 * Date: 2023-09-26
 * Time: 15:53
 */
// 响应状态码
public enum ResultCode {
    SUCCESS                     (0,"操作成功"),
    FAILED                      (1000,"操作失败");

    // 枚举中属性，方法默认都是 private
    // 状态码
    int code;
    // 描述信息
    String message;

    ResultCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public String toString() {
        return "code = " + code + " , message = " + message + ".";
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}

